package 笔试.携程;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import java.util.logging.Level;

/**
 * @author:谢君臣
 * @Date:2021/9/9-20:25
 * @version:1.0
 * @function:
 */
public class xc05 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int k = scanner.nextInt();
        int [] arr = new int[n];
        int i = 0;
        List<ArrayList<Integer>> lists = new ArrayList<>();
        while (i<n)
            arr[i++] = scanner.nextInt();
        if (n==k) System.out.println(0);
        i = 0;
        while (i<n){
            ArrayList<Integer> list = new ArrayList<>();
            list.add(arr[i++]);
            while (arr[i]==list.get(0))
                list.add(arr[i++]);
            lists.add(list);
        }
        if (k>=lists.size())
            System.out.println(0);
        else{
            fun(lists,k);
        }
    }

    private static void fun(List<ArrayList<Integer>> lists,int k) {
        int [] arr = new int[lists.size()];
        for (ArrayList<Integer> list : lists) {

        }
    }
}
